package cn.hs.controller;

import cn.hs.entity.UserCourse;
import cn.hs.service.UserCourseService;
import cn.hs.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName UserCourseController
 * @Description TODO
 * @Author wsh
 * @Date 2024年10月28日 16:26
 * @Version 1.0
 */
@RestController
@RequestMapping("/userCourse")
public class UserCourseController {
    @Autowired
    @Qualifier("userCourseServiceImpl")
    private UserCourseService userCourseService;
    @PostMapping("/insert")
    public Result insert(@RequestBody UserCourse userCourse){
        return userCourseService.insert(userCourse);
    }
    @PostMapping("/findAll")
    public Result findAll(Integer userId){
        List<UserCourse> list=userCourseService.findAll(userId);
        Result result=Result.success(list);
        return result;
    }


}
